//
//  ViewController.m
//  iosweb
//
//  Created by 廉英雷 on 15/11/15.
//  Copyright © 2015年 廉英雷. All rights reserved.
//

#import "ViewController.h"
#import "WebViewController.h"
#import "web2ViewController.h"

@interface ViewController ()

@property(nonatomic,weak) IBOutlet UIButton *btn1;

@property(nonatomic,weak) IBOutlet UIButton *btn2;
@property (weak, nonatomic) IBOutlet UIButton *btn3;
@end

@implementation ViewController
- (IBAction)btn3Click:(UIButton *)sender {
      

}

- (void)viewDidLoad {
      [super viewDidLoad];
      // Do any additional setup after loading the view, typically from a nib.
      self.view.backgroundColor = [UIColor whiteColor];
      self.btn1.layer.cornerRadius = 50;
      self.btn1.backgroundColor = [UIColor redColor];
      self.btn1.layer.masksToBounds = YES;
      self.btn2.layer.cornerRadius = 50;
      self.btn2.backgroundColor = [UIColor greenColor];
      self.btn2.layer.masksToBounds = 50;
      self.btn3.backgroundColor = [UIColor yellowColor];
      self.btn3.layer.cornerRadius = 50;
      self.btn3.layer.masksToBounds = YES;
      self.btn1.layer.borderWidth = 1.5;
      CGColorSpaceRef colorSpace1 = CGColorSpaceCreateDeviceRGB();
      CGColorRef colorref1 = CGColorCreate(colorSpace1,(CGFloat[]){ 0, 0, 0, 1 });

      self.btn1.layer.borderColor = colorref1;
      
    //  self.btn1.layer.cornerRadius = 5.5;
      UIButton *signBtn = [UIButton buttonWithType:UIButtonTypeCustom];
      signBtn.frame = CGRectMake(0, 0, 80, 40);
      [self.view addSubview:signBtn];
      [signBtn.layer setMasksToBounds:YES];
      [signBtn.layer setCornerRadius:10.0]; //设置矩形四个圆角半径
      [signBtn.layer setBorderWidth:1.0]; //边框宽度
      CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
      CGColorRef colorref = CGColorCreate(colorSpace,(CGFloat[]){ 1, 0, 0, 1 });
      
      [signBtn.layer setBorderColor:colorref];//边框颜色
      
      [signBtn setTitle:@"还  原" forState:UIControlStateNormal];//button title
      
      [signBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];//title color
      
      [signBtn addTarget:self action:@selector(buttonDonwRecover:) forControlEvents:UIControlEventTouchUpInside];//button 点击回调方法
      
      signBtn.backgroundColor = [UIColor whiteColor];
}
- (IBAction)web1Click:(id)sender {
      WebViewController *webVC = [[WebViewController alloc] initWithNibName:@"WebViewController" bundle:nil];
      UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:webVC];
      [self presentViewController:nav animated:YES completion:nil];

      
}
- (IBAction)web2Click:(id)sender {
      
      web2ViewController *web2VC = [[web2ViewController alloc] init];
      UINavigationController *nav = [[UINavigationController alloc
                                     ] initWithRootViewController:web2VC];
      [self presentViewController:nav animated:YES completion:nil];
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{

      
      
}


- (void)didReceiveMemoryWarning {
      [super didReceiveMemoryWarning];
      // Dispose of any resources that can be recreated.
}

@end
